package cate.game.play.buff.h;

import cate.game.play.buff.BuffHandler;
import cate.game.play.config.PlayCfgArgs;
import cate.game.play.proce.action.ctx.SkillActionCtx;

/**
 * 受到伤害时恢复已损失生命7%的生命值
 */
public class 复苏BH extends BuffHandler {

	private double 恢复系数;

	//恢复系数=700
	@Override
	public void parse(String code) {
		PlayCfgArgs args = new PlayCfgArgs(code);
		恢复系数 = args.getWDouble("恢复系数", 0d);
	}

	@Override
	public void afterSufferOneAttack(SkillActionCtx action, long totalDamage, boolean strike) {
		double healValue = buff.owner.attr.total().hpLoss() * 恢复系数;
		buff.owner.attr.buffHeal(action, buff.owner, healValue);
	}
}
